A. Field of the Invention
The present invention relates generally to high-speed data communications and, more particularly, to the framing of data transmitted over point-to-point links.
B. Description of Related Art
In certain high-speed data transmission links, data is transmitted as a continuous stream. For example, in the packet-over-SONET (POS) optical protocol, packets may be transmitted as a continuous data stream of bytes in which a number of consecutive bytes may comprise a larger unit of data such as a packet. Because no control information is transmitted external to the data stream, the receiving device delineates between packets in the stream based solely on the content of the stream.
In one conventional technique for framing such data streams, the receiving device delineates between packet boundaries by looking for predefined control bytes that are inserted within the data stream. Occasionally, actual content data may coincidentally have the same value as the control information. In this situation, the content data is preceded by an “escape byte” that lets the receiving device know that the next byte is content data.
FIGS. 1A and 1B are configurations of an exemplary stream of bytes before and after insertion of escape bytes. In FIG. 1A, a stream of four bytes 100 includes “h10”, “h7D”, “h08”, and “h7E”, where “h” indicates that the numbers are base 16 (hexadecimal) numbers. In this example, assume that “h7D” is used as the predetermined escape byte and “h7E” is a predetermined control byte that indicates the end of a packet.
The second and fourth bytes of packet stream 100 contain data that is identical to the escape byte “h7D” and the control byte “h7E”, respectively, and should therefore be escaped. FIG. 1B illustrates stream 100 after having “h7D” and “h7E” replaced. The second byte, “h7D,” is replaced with the escape character “h7D” followed by the original byte exclusive ORed with “h20.” The fourth byte, “h7E,” is replaced with the escape character “h7D” followed by the original byte exclusive ORed with “h20.” In this manner, the original four byte stream is expanded to a six byte stream.
The exclusive OR operation is performed so that the transmitted byte will no longer be a control character. The receiving device receives the escaped data stream of FIG. 1B, recognizes the “h7D” escape characters, removes the “h7D” escape characters, and XORs the character following the escape character with “h20” to thus recover the original data stream 100.
In high-bandwidth situations, a number of byte streams may be received simultaneously to create a multi-byte datapath. For example, in a three byte datapath, the bytes of a packet may be transmitted and received simultaneously in three byte blocks.
An escaping circuit for inserting escape characters in a multi-byte datapath, in one implementation, includes a number of pipelined stages. The first stage surrounds each received byte with blank bytes. A second stage of the pipeline then examines the data stream and, when appropriate, inserts escape characters in the blank bytes. A third stage is a “bytepacker” that compresses the data stream to remove any remaining blank bytes. One problem associated with this implementation is that as the datapaths become wider (e.g., a 32 byte datapath), the logic required to implement the pipeline stages, and in particular, the bytepacking stage, increases to a potentially untenably complicated level.
Thus, there is a need in the art to implement an efficient escaping circuit that easily scales as the size of the datapath increases.